package servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import controlleur.SuccursaleControlleur;

import messages.SystemMessage;

/**
 * Servlet implementation class ProduitServlet
 */
public class ProduitServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ProduitServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		final String action = request.getParameter(SystemMessage.ACTION);
		PrintWriter out = response.getWriter();
		if (action!= null)
		{
			/*if(action.equals(SystemMessage.get_))
			{
				//TODO : faire si utile
			}
			else if(action.equals(SystemMessage.GET_DET))
			{
				int idProduit = Integer.parseInt(request.getParameter(SystemMessage.SUCCURSALE_ID));
				out.print(((SuccursaleControlleur) ctrl).getSucc(idSuccur));
			}
			else if(action.equals(SystemMessage.ADD_NEW_DET))
			{
				
			}
			else if(action.equals(SystemMessage.DEL_DET))
			{
				
			}
			else if(action.equals(SystemMessage.UPD_DET))
			{
				
			}*/
		}
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		final String action = request.getParameter(SystemMessage.ACTION);
		PrintWriter out = response.getWriter();
		if (action!= null)
		{
			/*if(action.equals(SystemMessage.GET_ALL_SUCCUR))
			{
				
			}
			else if(action.equals(SystemMessage.GET_SUCCUR))
			{
				
			}
			else if(action.equals(SystemMessage.ADD_NEW_SUCCUR))
			{
				
			}
			else if(action.equals(SystemMessage.DEL_SUCCUR))
			{
				
			}
			else if(action.equals(SystemMessage.UPD_SUCCUR))
			{
				
			}*/
		}
	}

}
